-
Notifications
You must be signed in to change notification settings - Fork 173
feat: Complete Codex integration with enhanced architecture and UX improvements #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…itten to the workspace
…p solution when the agent requests interception.
Resolved conflicts in: - src/renderer/pages/conversation/gemini/GeminiWorkspace.tsx: Kept codex support in eventPrefix - src/renderer/pages/guid/index.tsx: Merged logos imports (both CodexLogo and IflowLogo) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Hi @kuishou68, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
- Cleaned up extensive debug logging from CodexMcpConnection.ts - Removed verbose console logs from CodexMcpAgent - Simplified CodexAgentManager logging to essential error/warning only - Fixed unused variable warnings in TypeScript - Removed unused pauseReason property - Fixed formatting and empty catch blocks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…anager - Added createContentMessage() in CodexAgentManager to handle content validation - Moved content filtering logic from transformMessage to CodexAgentManager layer - Simplified chatLib.ts transformMessage to assume pre-validated data - Updated all content message creation points to use new validation - Improved separation of concerns between common library and agent-specific logic Benefits: - chatLib.ts is now more generic and doesn't contain agent-specific logic - Content validation happens at the appropriate layer (agent manager) - Better maintainability and cleaner code architecture 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…essageToolGroup - Added optimized agentType-based conversation handler selection - Improved callId handling with toolCall.toolCallId fallback - Added direct import of acpConversation and codexConversation - Enhanced confirmation logic to avoid unnecessary API calls when agentType is available - Removed unused display variable Benefits: - Better performance by avoiding extra conversation.get calls - More robust callId handling for different agent types - Unified permission handling logic in MessageToolGroup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace hardcoded Chinese recovery actions in CodexAgentManager.ts with i18n keys - Add recovery_actions object to all locale files for network error suggestions - Internationalize ACP authentication error messages in guid/index.tsx - Add console_error and failed_confirm keys to acp.auth section - Fix TypeScript type errors with returnObjects option for array translations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Split 1,271-line CodexAgentManager into focused modules (83% reduction): - CodexAgentManager.ts (215 lines) - main controller following GeminiAgentManager pattern - CodexEventHandler.ts (173 lines) - unified event dispatcher - CodexMessageProcessor.ts (165 lines) - message flow handling - CodexToolHandlers.ts (251 lines) - tool execution handlers - Centralize type definitions in src/common/codexTypes.ts: - Replace all 'any' types with discriminated unions for type safety - Add comprehensive interfaces for all event data types - Provide extensible base interfaces for future message format expansion - Remove duplicate type definitions from original file - Maintain API compatibility while improving maintainability - Enable better IDE support with precise type inference 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Hi @kuishou68, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
…pe safety - Refactor transformMessage to eliminate undefined returns for better type safety - Move Codex-specific message handling logic from chatLib.ts to CodexEventHandler.ts - Extract ExtendedAcpPermissionRequest interface to Codex module for better encapsulation - Standardize message processing: content, user_content, error types in core chatLib - Remove unused CodexAgentManagerOriginal.ts backup file - Update CodexMessageProcessor to use standard content type instead of ai_content - Improve error handling with explicit error messages for unsupported message types
Co-authored-by: Qwen-Coder <[email protected]>
…nput box to be sent.
…placed in the generic conversation
…r to CodexMcpAgent.
…nto copyFilesToDirectory.
… has been changed to a dom driver.
- Merge onNetworkError and onError callbacks into unified onError with rich error context - Remove stream_error type from CodexEventMsg and update related processing - Replace manual codex/event construction with direct error handling - Simplify error processing flow: Connection → onError → MessageProcessor.processStreamError - Maintain encapsulation by keeping messageProcessor private with getter method - Add comprehensive error details (type, source, timeout info, retry counts) - Remove redundant wrapper methods in CodexEventHandler
…type parsing error field elicitation/create
…red base components Major refactoring to eliminate code duplication and improve maintainability: Permission Components: - Created BasePermissionDisplay for shared permission UI logic - Refactored MessageCodexPermission as factory component using subtype discrimination - Split into ExecApprovalDisplay and ApplyPatchApprovalDisplay with specialized rendering - Fixed permission ID generation to use call_id for uniqueness - Simplified CodexEventHandler logic by removing redundant data transformation Tool Call Components: - Created BaseToolCallDisplay for shared tool call UI structure - Eliminated duplicate StatusTag definitions across 4 components - Refactored ExecCommandDisplay, PatchDisplay, WebSearchDisplay, McpToolDisplay - Reduced code by 25-40% per component while maintaining functionality Type System Improvements: - Updated event data types to match actual JSON-RPC logs - Fixed FileChange union type to support both current and legacy formats - Made PatchApprovalData fields accurately reflect required vs optional properties - Removed unused utility functions from permissionUtils
…mponents - Add translation keys for 4 languages (en-US, zh-CN, zh-TW, ja-JP) - Replace hardcoded strings with t() function calls in Permission components - Replace hardcoded strings with t() function calls in ToolCall components - Fix titleKey translation handling in permission display components - Support dynamic translation of status labels, action buttons, and tool details
…noseconds - Calculate total duration as secs + nanos/1,000,000,000 - Display duration in ms for values < 1s, otherwise in seconds with 2 decimal places - Update i18n labels to support dynamic unit formatting - Fix issue where command execution time showed 0s instead of actual duration
…pport - Fix React hooks usage in ErrorService class by removing useTranslation - Remove unused context parameter from handleError method - Add structured error message format with error codes in MessageProcessor - Implement intelligent error translation in MessageTips component - Support multilingual error messages while maintaining backward compatibility - Clean up redundant error handling logic and simplify ErrorService
- Remove CLI --sandbox argument to avoid conflicts with directory detection - Add explicit sandbox parameter in MCP tool calls to override Codex defaults - Set sandboxMode: 'workspace-write' in createCodexAgent for file write permissions - Ensure new Codex sessions can create and modify files in workspace
Remove hardcoded 'Tool Call' title from emitCodexToolCall to allow Display components to handle their own titles using getDisplayTitle methods with proper internationalization support.
The --sandbox parameter was causing ACP connection timeouts for gemini/qwen/iflow backends due to sandbox mode restrictions on stdin/stdout communication and file system access.
…real return structures.
🤖 Hi @goworm, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
@gemini-cli /review is there any bugs? |
🤖 Hi @goworm, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
Summary
This PR introduces comprehensive Codex integration into AionUi, transforming the application into a unified platform supporting Gemini CLI, ACP backends, and Codex. The implementation includes a complete agent management system, message processing architecture, permission handling, and significant UX enhancements.
Major Features
🤖 Codex Integration (Core)
CodexMcpConnection
with JSON-RPC 2.0 communicationCodexAgentManager
with lifecycle management and conversation routing🛡️ Permission & Security System
🔧 Tool Execution & Display
📁 Enhanced File Operations
🌐 Error Handling & Recovery
💬 UX Improvements
Architecture Changes
New Agent Layer Structure
Type System Enhancements
Component Organization
acp/
andcodex/
subfolders for better organizationBasePermissionDisplay
andBaseToolCallDisplay
for shared UI patternsTechnical Highlights
Message Flow Architecture
Streaming Response Handling
Workspace Management
GeminiWorkspace
toChatWorkspace
for multi-agent supportConfiguration & Storage
appConfig.ts
for dynamic constants and Electron integrationInternationalization
Complete i18n coverage for all new features:
Translation additions: ~200+ new keys per language covering:
Bug Fixes & Optimizations
Fixed Issues
--sandbox
flag removedPerformance Improvements
Code Quality
Breaking Changes
GeminiWorkspace
component renamed toChatWorkspace
Migration Notes
Testing
Stats
Version
Updated to v1.2.5